package com.sky.blog.controller;

import com.sky.blog.service.BlogCategoryService;
import com.sky.blog.vo.Results;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author sky  2022/3/28
 * @version 1.0
 */

@RestController
@RequestMapping("/blog/category")
public class BlogCategoryController {

    @Resource
    private BlogCategoryService blogCategoryService;

    @GetMapping("header")
    @ApiOperation("顶栏的博客分类标题")
    public Results getCategoryToHeader() {
        return Results.SUCCESS.data(blogCategoryService.getBlogHeaderCategories());
    }
}
